<%@ page import="com.apexedu.portal.constant.Constants" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    request.setAttribute("basePath", request.getContextPath());
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title><%=Constants.ProjectInfo.PROJECT_NAME%></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="${basePath}/clientui/js/jquery-1.4.js"></script>
    <link href="${basePath}/resources/css/mh.shd.css" rel="stylesheet">
    <link href="${basePath}/resources/css/portal.server.css" rel="stylesheet" type="text/css"/>
    <script src="${basePath}/resources/js/mh.shd.index.js" type="text/javascript"></script>
    <link href="${basePath}/resources/css/portal.server.detail.css" rel="stylesheet" type="text/css"/>
    <script src="${basePath}/resources/js/portal.server.detail.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function(){
            onLoadHeight();

            //菜单分类数
            var countUl = $("ul.typeUl > li").length;
            $(".typeUlDiv,ul.typeUl").width(countUl * 83);
            if (countUl > 8) { //大于八个分类时显示滚动按钮
                $(".turnRightDiv").addClass("choosed");
                $(".turnRightDiv.choosed").live("click", function () { //向左滚动按钮点击事件
                    var left = parseInt($(".typeUlDiv").css("left").replace("px", ""), 10);
                    if (left + countUl * 83 - 83 < 665) {
                        $(".turnRightDiv").removeClass("choosed");
                    }
                    $(".typeUlDiv").css("left", left - 83);
                    $(".turnLeftDiv").addClass("choosed");
                });
                $(".turnLeftDiv.choosed").live("click", function () {//向右滚动按钮点击事件
                    var left = parseInt($(".typeUlDiv").css("left").replace("px", ""), 10);
                    $(".typeUlDiv").css("left", left + 83);
                    if (left + 83 == 0) {
                        $(".turnLeftDiv").removeClass("choosed");
                    }
                    $(".turnRightDiv").addClass("choosed");
                })
            } else { //小于八个分类时隐藏滚动按钮
                $(".turnRightDiv,.turnLeftDiv").hide();
            }

            $("ul.typeUl > li").live("click", function () {
                var index = $(this).prevAll().length;
                $("ul.typeUl > li").removeClass("choosed");
                $(this).addClass("choosed");
                $(".kdyDiv ul.subMenuUl.choosed").removeClass("choosed");
                $(".kdyDiv ul.subMenuUl:eq(" + index + ")").addClass("choosed");
            });


            //增加 添加问题事件
            $(".dyan").click(function() {
                $(".addfeedback_box").show();
                var menuid=$(this).siblings('.menuid').val();
                var menuname=$(this).siblings('.menuname').val();
                $(".service_detail_info .service_detail_name").attr("menuid",menuid);
                $(".service_detail_info .service_detail_name").attr("menuname",menuname);
                $("#zx_"+menuid).attr("checked",'checked');
                $('.comments').hide();
                $('.addreplys').hide();
                $('.zwpl').hide();
            });
        });

        function onLoadHeight(){
            $("#right").height($("#contentSub").height()+$("#head").height()+50);
            $("#left").height($("#right").height());
        }
        //搜索服务
        function seachService() {
            $(".kdyDiv .kdyfwDiv ul li:not([dy])").show().has(".iconTitleShd:not(:contains('" + $("input[name=serviceText]").val() + "'))").hide();
        }
    </script>
    <style>
        .searchButton {
            background-color: blue;
            border: 1px solid #aabbcc;
            font-size: 12px;
            height: 24px;
            line-height: 22px;
            color: white;
        }
        .titleDiv {height: 40px;line-height: 40px;font-size: 20px;text-indent: 10px;color:#959698;text-align: left;margin-bottom: 20px;font-weight: normal;
        }
        .mainDiv .leftDiv .dyDiv{height:560px;}
        .mainDiv .leftDiv .kdyDiv .kdyfwDiv{width: 100%;}
        ul.subMenuUl{width: 100%;margin: 0;list-style: none;}
        ul.subMenuUl li{float: left;width: 150px;margin: 20px 0;position: relative;}
        ul.subMenuUl li div{text-align: center;color:#959698; }
        ul.subMenuUl li div img{position: static;width: auto;height: 60px;}
        .dybutton{
            font-size: 12px;
            height: 20px;
            line-height: 20px;
            border: 1px solid #0079DA;
            width: 80px;
            border-radius: 5px;
            margin: 10px auto 0;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div id="main">
    <input type="hidden" id="choosed" value="2"/>
    <jsp:include page="../shd/left.jsp"/>
    <div id="right" style="min-height: 1400px;">
        <jsp:include page="../shd/head.jsp"/>
        <div id="contentSub"style="left:0px;position: absolute;">
            <div class="mainDiv" style="border: none;width: 100%;">
                <div class="leftDiv" style="border: none;width: 98%;">
                    <div class="kdyDiv" style="background:#fff;border: none;width: 98%;">
                        <div class="kdySubDiv">
                            <div class="titleDiv">
                                <div style="width: 200px;float:left;"> 可咨询服务</div>
                                <div style="float:left;margin-left: 130px;">
                                    <input type="text" class="search" name="serviceText"/>
                                    <span class="searchButtonSpan" onclick="seachService()">查 询 </span>
                                </div>
                            </div>
                            <div class="kdyfwflDiv" style="margin-bottom: 20px;">
                                <div class="turnLeftDiv"><</div>
                                <div class="content">
                                    <div class="typeUlDiv">
                                        <ul class="typeUl">
                                            <c:forEach items="${listMenu}" var="menu" varStatus="status">
                                                <li  <c:if test="${status.index == 0}">class="choosed"</c:if>>${menu.menuname}</li>
                                            </c:forEach>
                                        </ul>
                                    </div>
                                </div>
                                <div class="turnRightDiv">></div>
                                <div style="clear: both"></div>
                            </div>
                            <div class="kdyfwDiv">
                                <c:forEach items="${listMenu}" var="menu" varStatus="status">
                                    <ul class="subMenuUl <c:if test="${status.index == 0}">choosed</c:if>">
                                        <c:forEach items="${menu.listMenuSub}" var="menuSub">
                                            <li menuid="${menuSub.menuid}" menuname="${menuSub.menuname}"
                                                menutb="${menuSub.tb}" menupath="${menuSub.menupath}">
                                                <div class="fwnr" onclick="window.open('${basePath}/s/uc/se/sd/${menuSub.menuid}')">
                                                    <img src="${basePath}/resources/images/shd/icons/${menuSub.tb}"  onError="this.src='${basePath}/resources/images/shd/icon_banshidating.png'" title="查看详情"/>
                                                </div>
                                                <div class="iconTitleShd"><input type="radio" name="zx" id="zx_${menuSub.menuid}" class="zx" value="${menuSub.menuid}"/>${menuSub.menuname}</div>
                                                <input type="hidden" value="${menuSub.menuid}" class="menuid">
                                                <input type="hidden" value="${menuSub.menuname}" class="menuname">
                                                <div class="dyan dybutton" title="点击咨询" >咨询</div>
                                            </li>
                                        </c:forEach>
                                    </ul>
                                </c:forEach>
                            </div>
                        </div>
                    </div>
                    <div class="dyDiv" style="background: #FAFAFA;border: none;margin-top:10px;width: 98%;">
                        <div class="service_detail_info">
                            <div class="service_detail_name" menuid="" username="${userid}" menuname=""></div>
                        </div>
                        <div class="service_detail_feedback">
                            <div class="service_detail_title">问题反馈</div>
                            <span class="addfeedback">添加问题</span>
                            <div class="addfeedback_box" style="display:none;">
                                问题类型：
                                <c:forEach items="${protypes}" var="t" varStatus="status">
                                    <input type="radio" name="tid" class="tid" value="${t.wid}" <c:if test="${status.index == 0}">checked</c:if>>${t.name}
                                </c:forEach>
                                <div>
                                    标题：<input name="pproblem" id="pproblem"
                                              style="width:400px;height:25px;line-hight:25px;"/><br/>
                                </div>
                                <span style="vertical-align: top;">内容：</span><textarea id="pcontent" name="pcontent"
                                                                                       maxlength="200" class="input-xxlarge"
                                                                                       rows="10" cols="100"></textarea>

                                <div class="addfeedback_btnbox" style="margin-left:30px;">
                                    <input type="button" class="addfeedback_sub" value="提交"/> <input type="button"
                                                                                                     class="addfeedback_cancel"
                                                                                                     value="取消"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="clear: both;"></div>
            </div>
        </div>
        <%--<jsp:include page="../shd/foot.jsp"/>--%>
    </div>
</div>
</body>
</html>
